home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / WINDOWS / WXLSLIB.ARJ / LEUKEMIA.LSP < prev    next >
Lisp/Scheme  |  1992-02-20  |  707b  |  24 lines

  1. (def wbc-pos (list 2300 750 4300 2600 6000 10500 10000 17000 5400 7000
  2.                    9400 32000 35000 100000 100000 52000 100000))
  3.  
  4. (def transformed-wbc-pos (- (log wbc-pos) (log 10000)))
  5.  
  6. (def times-pos (list 65 156 100 134 16 108 121 4 39 143 56 26 22 1 1 5 65))
  7.  
  8. (defun llik-pos (theta)
  9.   (let* ((x transformed-wbc-pos)
  10.      (y times-pos)
  11.      (theta0 (select theta 0))
  12.      (theta1 (select theta 1))
  13.      (t1x (* theta1 x)))
  14.     (- (sum t1x)
  15.        (* (length x) (log theta0))
  16.        (/ (sum (* y (exp t1x)))
  17.       theta0))))
  18.  
  19. (defun lk-sprob (theta)
  20.   (let* ((time 52.0)
  21.          (x (log 5))
  22.          (mu (* (select theta 0) (exp (- (* (select theta 1) x))))))
  23.     (exp (- (/ time mu)))))
  24.